package com.yf1706.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.security.auth.message.callback.PrivateKeyCallback.Request;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.yf1706.bean.CheckHolidayKind;
import com.yf1706.bean.ComprehensiveQuestion;
import com.yf1706.bean.CountIncomeTaxRate;
import com.yf1706.bean.Dep;
import com.yf1706.bean.GapFilling;
import com.yf1706.bean.Judge;
import com.yf1706.bean.Multiselect;
import com.yf1706.bean.QuestionBank;
import com.yf1706.bean.SingleChoice;
import com.yf1706.service.DepService;
import com.yf1706.service.comprehensiveService;
import com.yf1706.service.fillingService;
import com.yf1706.service.judgeService;
import com.yf1706.service.multiSelectService;
import com.yf1706.service.questionBankService;
import com.yf1706.service.singleChoiceService;
import com.yf1706.tools.JsonTool;
import com.yf1706.vo.Information;
import com.yf1706.vo.questionbankAddComprehensive;
import com.yf1706.vo.questionbankAddFill;
import com.yf1706.vo.questionbankAddJudge;
import com.yf1706.vo.questionbankAddMultiSelect;
import com.yf1706.vo.questionbankaddSingleChoice;

@Controller
@RequestMapping("exam")
public class ExamController extends BaseController{
	@Autowired
	private multiSelectService mlss; 
	
	@Autowired
	private questionBankService qbs;
	
	@Autowired
	private DepService depservice;
	
	@Autowired
	private singleChoiceService scService;
	
	@Autowired
	private fillingService fillservice;
	
	@Autowired
	private judgeService judgeservice;
	
	@Autowired
	private comprehensiveService chservice;
	
	@RequestMapping("examBackHome")
	public String examhome() {
		System.out.println("exam_back_home");
		return "wjl/exam_back_home";
	}
	@RequestMapping("question_bank")
	public String question_bank() {
		System.out.println("question_bank");
		return "wjl/question_bank";
	}
	@RequestMapping("single_choice")
	public String single_choice() {
		System.out.println("single_choice");
		return "wjl/single_choice";
	}
	@RequestMapping("multiSelect")
	public String multiSelect() {
		System.out.println("multiSelect");
		return "wjl/multiSelect";
	}
	@RequestMapping("judge")
	public String judge() {
		System.out.println("judge");
		return "wjl/judge";
	}
	@RequestMapping("gapfilling")
	public String gapfilling() {
		System.out.println("gapfilling");
		return "wjl/gapfilling";
	}
	@RequestMapping("comprehensive")
	public String comprehensive() {
		System.out.println("comprehensive");
		return "wjl/comprehensive";
	}
	@RequestMapping("examScore")
	public String examScore() {
		System.out.println("examScore");
		return "wjl/examScore";
	}
	@RequestMapping("in_exam_registration")
	public String in_exam_registration() {
		System.out.println("in_exam_registration");
		return "wjl/in_exam_registration";
	}
	@RequestMapping("out_exam_registration")
	public String out_exam_registration() {
		System.out.println("out_exam_registration");
		return "wjl/out_exam_registration";
	}
	@RequestMapping("employee_performence")
	public String employee_performence() {
		System.out.println("employee_performence");
		return "wjl/employee_performence";
	}
	@RequestMapping("errorCount")
	public String errorCount() {
		System.out.println("errorCount");
		return "wjl/errorCount";
	}
	@RequestMapping("test_score")
	public String test_score() {
		System.out.println("test_score");
		return "wjl/test_score";
	}
	
	@RequestMapping("examArrangement")
	public String examArrangement() {
		System.out.println("examArrangement");
		return "wjl/examArrangement";
	}
	//查询所有多选题信息
	@RequestMapping("getMultiselect")
	@ResponseBody
	public List<Multiselect> getMultiselect(){
		System.out.println(mlss.getMultiselect());
		return mlss.getMultiselect();
	}
	//查询所有题库信息
		@RequestMapping("getAllQuestionBank")
		@ResponseBody
		public Map<String, Object> getAllQuestionBank(int page,int rows){
			System.out.println(page+" "+rows);
			Page<QuestionBank> pages = PageHelper.startPage(page, rows);
			List<QuestionBank> list = qbs.queryAllQuestionBank();
			long total = pages.getTotal();
			Map<String, Object> map = new HashMap<String, Object>();
			map.put("total", total);
			map.put("rows", list);
			return map;
		}
	//查询所有部门
	@RequestMapping("getAllDep")
	@ResponseBody
	public List<Dep> getAllDept() {
		System.out.println("getAllDep");
		return depservice.findAllDep();
	}
	//查询所有题库，用于下拉框
	@RequestMapping("getAllquestionBank")
	@ResponseBody
	public List<QuestionBank> getAllquestionBank() {
		return qbs.queryAllQuestionBank();
	}
	//保存题库
	@RequestMapping("addquestionBank")
	@ResponseBody
	public void addquestionBank(String qbName,int depId,HttpServletRequest request) {
		System.out.println(qbName+" "+depId);
		QuestionBank qb=new QuestionBank();
		qb.setQbName(qbName);
		qb.setCreatePeople(getSessionUserName(request));
		qb.setCreateDate(new Date());
		Dep dep=depservice.findByDepId(depId);
		List<QuestionBank> list=qbs.queryAllQuestionBank();
		int a=0;
		for(int i=0;i<list.size();i++) {
			if(list.get(i).getDep().getDepId()!=depId) {
				a=1;
			}
		}
		if(a==1) {
			qb.setDep(dep);
			qbs.saveQb(qb);
			depservice.addQuestionbankId(dep, qb);
		}
		
	}
	
	@RequestMapping("questionbankInfo")
	@ResponseBody
	public ModelAndView questionbankInfo(int qbId,HttpServletRequest request,HttpServletResponse response) {
		HttpSession session=request.getSession();
		session.setAttribute("qbid", qbId);
		ModelAndView mv=new ModelAndView("wjl/questionbankAllQuestion");
		mv.addObject("id",qbId);
		System.out.println(qbId);
		return mv;
	}
	
	/*@RequestMapping("data")
	@ResponseBody
	public Map<String,Object> getData(int id){
		QuestionBank q=qbs.findByQbId(id);
		Map<String,Object> map=new HashMap<String,Object>();
		List<SingleChoice> sc=scService.findByQuestionBank(q);
		List<Multiselect> ms=mlss.findByQuestionBank(q);
		List<ComprehensiveQuestion> chq=chservice.findByQuestionBank(q);
		List<Judge> jg=judgeservice.findByQuestionBank(q);
		List<GapFilling> filling=fillservice.findByQuestionBank(q);
		map.put("1", sc);
		System.out.println("Hhh");
		return map;
	}*/
	
	//查询本题库中的单选题
	@RequestMapping("questionbankSingleChoiceInfo")
	@ResponseBody
	public Map<String, Object> questionbankSingleChoiceInfo(int qbId,int page,int rows) {
		Page<SingleChoice> pages = PageHelper.startPage(page, rows);
		List<SingleChoice> list = scService.querybyQbId(qbId);
		long total = pages.getTotal();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("total", total);
		map.put("rows", list);
		return map;
	}
	
	//查询本体库中的多选题
	@RequestMapping("questionbankMultiSelectInfo")
	@ResponseBody
	public Map<String, Object> questionbankMultiSelectInfo(int qbId,int page,int rows) {
		Page<Multiselect> pages = PageHelper.startPage(page, rows);
		List<Multiselect> list = mlss.querybyQbId(qbId);
		long total = pages.getTotal();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("total", total);
		map.put("rows", list);
		return map;
	}
	//查询本体库中的填空题
		@RequestMapping("questionbankFillingInfo")
		@ResponseBody
		public Map<String, Object> questionbankFillingInfo(int qbId,int page, int rows) {
			Page<GapFilling> pages = PageHelper.startPage(page, rows);
			List<GapFilling> list = fillservice.querybyQbId(qbId);
			long total = pages.getTotal();
			Map<String, Object> map = new HashMap<String, Object>();
			map.put("total", total);
			map.put("rows", list);
			return map;
		}
		
		//查询本体库中的判断题
				@RequestMapping("questionbankJudgeInfo")
				@ResponseBody
				public Map<String, Object> questionbankJudgeInfo(int qbId,int page,int rows) {
					Page<Judge> pages = PageHelper.startPage(page, rows);
					List<Judge> list = judgeservice.querybyQbId(qbId);
					long total = pages.getTotal();
					Map<String, Object> map = new HashMap<String, Object>();
					map.put("total", total);
					map.put("rows", list);
					return map;
				}
				//查询本体库中的综合题
				@RequestMapping("questionbankComprehensiveInfo")
				@ResponseBody
				public Map<String, Object> questionbankComprehensiveInfo(int qbId,int page,int rows) {
					Page<ComprehensiveQuestion> pages = PageHelper.startPage(page, rows);
					List<ComprehensiveQuestion> list = chservice.querybyQbId(qbId);
					long total = pages.getTotal();
					Map<String, Object> map = new HashMap<String, Object>();
					map.put("total", total);
					map.put("rows", list);
					return map;
				}
	
	
	//在题库中添加此题库的单选题目
		@RequestMapping("addquestionbanSingleChoice")
		@ResponseBody
		public Information addquestionbanSingleChoice(HttpServletRequest request1,HttpSession request) {
			try {
			String jsondata=request1.getParameter("jsondata");
			 List<questionbankaddSingleChoice> list = JSONObject.parseArray(jsondata, questionbankaddSingleChoice.class);
			 scService.questionbankAddSingleChoice(list.get(0).getAnswer(),list.get(0).getA(), list.get(0).getB(), list.get(0).getC(), list.get(0).getD(), list.get(0).getExamQuestion(), list.get(0).getQbId(),getSessionUserName(request1));
			 qbs.changeSingleChoiceNum(request);
			 // PrintWriter out;
				
				//	out = response.getWriter();
				//	out.print("ok");
					return Information.getInstance();
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
					return Information.getInstance(e);
				}	
				
			
		}
		//在题库中添加此题库的多选题目
				@RequestMapping("addquestionbanMultiSelect")
				@ResponseBody
				public Information addquestionbanMultiSelect(HttpServletRequest request1,HttpSession request) {
					try {
						String jsondata=request1.getParameter("jsondata");
					 List<questionbankAddMultiSelect> list = JSONObject.parseArray(jsondata, questionbankAddMultiSelect.class);
					 mlss.questionbankAddMultiSelect(list.get(0).getAnswer(),list.get(0).getA(), list.get(0).getB(), list.get(0).getC(), list.get(0).getD(), list.get(0).getExamQuestion(), list.get(0).getQbId(),getSessionUserName(request1));
					 qbs.changeMultiselect(request);
					 return Information.getInstance();
					} catch (Exception e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
						return Information.getInstance(e);
					}	
					
				
			}
				//在题库中添加此题库的填空题目
				@RequestMapping("addquestionbanFilling")
				@ResponseBody
				public Information addquestionbanFilling(HttpServletRequest request1,HttpSession request) {
				try { 
					String jsondata=request1.getParameter("jsondata");
					 List<questionbankAddFill> list = JSONObject.parseArray(jsondata, questionbankAddFill.class);
					 fillservice.questionbankAddFilling(list.get(0).getAnswer(), list.get(0).getExamQuestion(), list.get(0).getQbId(),getSessionUserName(request1));
					 qbs.changeFillingNum(request);
					 return Information.getInstance();
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
					return Information.getInstance(e);
				}	
				
			
		}
				
				//在题库中添加此题库的判断题目
				@RequestMapping("addquestionbanJudge")
				@ResponseBody
				public Information addquestionbanJudge(HttpServletRequest request1,HttpSession request) {
				try { 
					String jsondata=request1.getParameter("jsondata");
					 List<questionbankAddJudge> list = JSONObject.parseArray(jsondata, questionbankAddJudge.class);
					 judgeservice.questionbankAddJudge(list.get(0).getAnswer(), list.get(0).getExamQuestion(), list.get(0).getQbId(),getSessionUserName(request1));
					 qbs.changeJudgeNum(request);
					 return Information.getInstance();
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
					return Information.getInstance(e);
				}	
				
			
		}
				//在题库中添加此题库的综合题目
				@RequestMapping("addquestionbanComprehensive")
				@ResponseBody
				public Information addquestionbanComprehensive(HttpServletRequest request1,HttpSession request) {
					try { 
					String jsondata=request1.getParameter("jsondata");
					 List<questionbankAddComprehensive> list = JSONObject.parseArray(jsondata, questionbankAddComprehensive.class);
					 chservice.questionbankAddComprehensive(list.get(0).getAnswer(), list.get(0).getExamQuestion(), list.get(0).getQbId(),getSessionUserName(request1));
					 qbs.changeComprehensiveNum(request);
					 return Information.getInstance();
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
					return Information.getInstance(e);
				}	
				
			
		}
				
				//返回当前题库中所选中的题型的所有题目页面
				@RequestMapping("questionbankSingleChoice")
				public String questionbankSingleChoice() {
					return "wjl/questionbankAllQuestion";
				}
				
				@RequestMapping("questionbankMultiSelect")
				public String questionbankMultiSelect() {
					return "wjl/questionbankMultiSelect";
				}
				
				@RequestMapping("questionbankJudge")
				public String questionbankJudge() {
					return "wjl/questionbankJudge";
				}
				
				@RequestMapping("questionbankFilling")
				public String questionbankFilling() {
					return "wjl/questionbankFilling";
				}
				
				@RequestMapping("questionbankComprehensive")
				public String questionbankComprehensive() {
					return "wjl/questionbankComprehensive";
				}
				
				//通过题库名模糊查询题库
				@RequestMapping("getQuestionBank_Search")
				@ResponseBody
				public Map<String, Object> getQuestionBank_Search(int page,int rows,HttpServletRequest request){
					String qbName=request.getParameter("qbName");
					int depId=Integer.parseInt(request.getParameter("depId"));
					System.out.println(qbName+depId+page+rows);
					Page<QuestionBank> pages = PageHelper.startPage(page, rows);
					List<QuestionBank> list = qbs.queryQuestionBankSearch(qbName,depId);
					System.out.println(list.size());
					long total = pages.getTotal();
					Map<String, Object> map = new HashMap<String, Object>();
					map.put("total", total);
					map.put("rows", list);
					return map;
					
				}
	
	//在题库中删除题
		@RequestMapping("deleteQuestionBankSingleChoice")
		@ResponseBody
		public Information deleteQuestionBankSingleChoice(HttpServletRequest request,HttpSession request1) {
			try {
				String jsondata=request.getParameter("wjl_rowdata");
				List<Integer> list = (List<Integer>) JSONObject.parse(jsondata);
				System.out.println(list.size());
			       for (Integer o : list) {
			    	   System.out.println("list:"+o.intValue());
			    	   scService.deleteQuestionBankSingleChoice(o.intValue());
				}
			       qbs.updateQuestionSingleChoice(request1, list.size());
				return Information.getInstance();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return Information.getInstance(e);
			}	
		}
		
		@RequestMapping("deleteQuestionBankMultiSelect")
		@ResponseBody
		public Information deleteQuestionBankMultiSelect(HttpServletRequest request,HttpSession request1) {
			try {
				String jsondata=request.getParameter("wjl_rowdata");
				List<Integer> list = (List<Integer>) JSONObject.parse(jsondata);
				System.out.println(list.size());
			       for (Integer o : list) {
			    	   System.out.println("list:"+o.intValue());
			    	   mlss.deleteQuestionBankMultiSelect(o.intValue());
				}
			       qbs.updateQuestionMultiSelect(request1, list.size());
				return Information.getInstance();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return Information.getInstance(e);
			}	
		}
		
		@RequestMapping("deleteQuestionBankJudge")
		@ResponseBody
		public Information deleteQuestionBankJudge(HttpServletRequest request,HttpSession request1) {
			try {
				String jsondata=request.getParameter("wjl_rowdata");
				List<Integer> list = (List<Integer>) JSONObject.parse(jsondata);
				System.out.println(list.size());
			       for (Integer o : list) {
			    	   System.out.println("list:"+o.intValue());
			    	   judgeservice.deleteQuestionBankJudge(o.intValue());
				}
			       qbs.updateQuestionJudge(request1, list.size());
				return Information.getInstance();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return Information.getInstance(e);
			}	
		}
		
		@RequestMapping("deleteQuestionBankFilling")
		@ResponseBody
		public Information deleteQuestionBankFilling(HttpServletRequest request,HttpSession request1) {
			try {
				String jsondata=request.getParameter("wjl_rowdata");
				List<Integer> list = (List<Integer>) JSONObject.parse(jsondata);
				System.out.println(list.size());
			       for (Integer o : list) {
			    	   System.out.println("list:"+o.intValue());
			    	   fillservice.deleteQuestionBankFilling(o.intValue());
				}
			       qbs.updateQuestionFilling(request1, list.size());
				return Information.getInstance();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return Information.getInstance(e);
			}	
		}
		@RequestMapping("deleteQuestionBankComprehensive")
		@ResponseBody
		public Information deleteQuestionBankComprehensive(HttpServletRequest request,HttpSession request1) {
			try {
				String jsondata=request.getParameter("wjl_rowdata");
				List<Integer> list = (List<Integer>) JSONObject.parse(jsondata);
				System.out.println(list.size());
			       for (Integer o : list) {
			    	   System.out.println("list:"+o.intValue());
			    	   chservice.deleteQuestionBankComprehensive(o.intValue());
				}
			       qbs.updateQuestionComprehensive(request1, list.size());
				return Information.getInstance();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return Information.getInstance(e);
			}	
		}
		
		//查询所有的单选题
		@RequestMapping("getAllSingleChoice")
		@ResponseBody
		public Map<String,Object> getAllSingleChoice(int page,int rows){
			System.out.println("进入单选controller");
			Page<SingleChoice> pages = PageHelper.startPage(page, rows);
			List<SingleChoice> list = scService.queryAllSingleChoice();
			long total = pages.getTotal();
			Map<String, Object> map = new HashMap<String, Object>();
			map.put("total", total);
			map.put("rows", list);
			return map;
		}
		
		//
		@RequestMapping("SingleChoiceSearch")
		@ResponseBody
		public  Map<String, Object> SingleChoiceSearch(HttpServletRequest request,int page,int rows){
			Page<SingleChoice> pages = PageHelper.startPage(page, rows);
			String value=request.getParameter("value");
			String[] val=value.split(",");
			int qbId=Integer.parseInt(val[0]);
			String examQuestion=val[1];
			System.out.println(qbId+" "+examQuestion);
			Map<String, Object> map = new HashMap<String, Object>();
			long total = pages.getTotal();
			map.put("total", total);
			int a=0;
			if(examQuestion.equals("error")) {
				a=1;
			}
			if(a==1&&qbId==0) {
				
				List<SingleChoice> list=scService.queryAllSingleChoice();
				map.put("rows", list);
				return map;
				
			}else if(qbId!=0&&a==1) {
				List<SingleChoice> list=scService.queryAllByQbIdAndExamQuestion(qbId,"");
				map.put("rows", list);
				return map;
			}else {
				List<SingleChoice> list=scService.queryAllByQbIdAndExamQuestion(qbId,examQuestion);
				map.put("rows", list);
				return map;
			}
			
		}
		//单选表中删除
		@RequestMapping("deleteSingleChoice")
		@ResponseBody
		public  void deleteSingleChoice(HttpServletRequest request){
			String value=request.getParameter("value");
			String[] val=value.split(",");
			
			System.err.println(val.length);
			for(int i=0;i<val.length;i++) {
				int singleChoiceId=Integer.parseInt(val[i]);
				System.err.println(singleChoiceId);
				int qbId=scService.findBySingleChoiceId(singleChoiceId).get(0).getQuestionBank().getQbId();
				qbs.deleteSingleChoiceByQbId(qbId);
				scService.deletSingleChoiceById(singleChoiceId);
				
			}
			
			
		}
		
		
		//在单选按钮界面新增单选题
		@RequestMapping("SingleChoiceAdd")
		@ResponseBody
		public void SingleChoiceAdd(HttpServletRequest request) {
			String value=request.getParameter("qbId");
			String answer=request.getParameter("answer");
			String a=request.getParameter("a");
			String b=request.getParameter("b");
			String c=request.getParameter("c");
			String d=request.getParameter("d");
			String examQuestion=request.getParameter("examQuestion");
			int qbid=Integer.parseInt(value);
			scService.add(examQuestion,a,b,c,d,answer,qbid,getSessionUserName(request));
			qbs.ChangeSingleChoiceNum(qbid);
		}
		
				
				
		//------------------------------------------------------
		
				//查询所有的多选题
				@RequestMapping("getAllMultiSelect")
				@ResponseBody
				public Map<String,Object> getAllMultiSelect(int page,int rows){
					System.out.println("进入单选controller");
					Page<Multiselect> pages = PageHelper.startPage(page, rows);
					List<Multiselect> list = mlss.getMultiselect();
					long total = pages.getTotal();
					Map<String, Object> map = new HashMap<String, Object>();
					map.put("total", total);
					map.put("rows", list);
					return map;
				}
				
				//
				@RequestMapping("MultiSelectSearch")
				@ResponseBody
				public  Map<String, Object> MultiSelectSearch(HttpServletRequest request,int page,int rows){
					Page<Multiselect> pages = PageHelper.startPage(page, rows);
					String value=request.getParameter("value");
					String[] val=value.split(",");
					int qbId=Integer.parseInt(val[0]);
					String examQuestion=val[1];
					System.out.println(qbId+" "+examQuestion);
					Map<String, Object> map = new HashMap<String, Object>();
					long total = pages.getTotal();
					map.put("total", total);
					int a=0;
					if(examQuestion.equals("error")) {
						a=1;
					}
					if(a==1&&qbId==0) {
						
						List<Multiselect> list=mlss.getMultiselect();
						map.put("rows", list);
						return map;
						
					}else if(qbId!=0&&a==1) {
						List<Multiselect> list=mlss.queryAllByQbIdAndExamQuestion(qbId,"");
						map.put("rows", list);
						return map;
					}else {
						List<Multiselect> list=mlss.queryAllByQbIdAndExamQuestion(qbId,examQuestion);
						map.put("rows", list);
						return map;
					}
					
				}
				
				@RequestMapping("deleteMultiSelect")
				@ResponseBody
				public void deleteMultiSelect(HttpServletRequest request){
					String value=request.getParameter("value");
					String[] val=value.split(",");
					
					System.err.println(val.length);
					for(int i=0;i<val.length;i++) {
						int multiselectId=Integer.parseInt(val[i]);
						System.err.println(multiselectId);
						
						int qbId=mlss.findByMultiSelectId(multiselectId).get(0).getQuestionBank().getQbId();
						qbs.deleteMultiselectByQbId(qbId);
						mlss.deletMultiselectById(multiselectId);
						
					}
					
				}
				
				
				
				@RequestMapping("MultiSelectAdd")
				@ResponseBody
				public void MultiSelectAdd(HttpServletRequest request) {
					String value=request.getParameter("qbId");
					String answerm=request.getParameter("answerm");
					String am=request.getParameter("am");
					String bm=request.getParameter("bm");
					String cm=request.getParameter("cm");
					String dm=request.getParameter("dm");
					String examQuestionm=request.getParameter("examQuestionm");
					
					int qbIdm=Integer.parseInt(value);
					mlss.questionbankAddMultiSelect(answerm,am,bm,cm,dm,examQuestionm,value,getSessionUserName(request));
					qbs.ChangeMultiSelectNum(qbIdm);
				}
				
						
				
}